home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 121_01 / setup.c < prev    next >
Text File  |  1985-08-19  |  1KB  |  47 lines

  1. /*
  2. HEADER: CUG 121.??;
  3.  
  4.     TITLE:    Setup - inits teleray 10 function keys;
  5.     VERSION:    1.0;
  6.     DATE:    09/01/85;
  7.     DESCRIPTION: "This program assigns strings to function keys 1-4
  8.         of a teleray 10 terminal.";
  9.     KEYWORDS:    teleray, function keys;
  10.     SYSTEM:    CP/M;
  11.     FILENAME:    SETUP.C;
  12.     WARNINGS:    "Requires a Teleray 10 terminal.  Sets the function keys
  13.         to values hard-coded in the program.  Not too general-purpose,
  14.         huh ?";
  15.     AUTHORS:    Mike W. Meyer;
  16.     COMPILERS:    BDS-C 1.50;
  17. */
  18.  
  19. #include <bdscio.h>
  20.  
  21. main(argc, argv) char **argv; {
  22.     char *p, buffer[MAXLINE] ;
  23.  
  24.     if (argc != 2) {
  25.         puts("setup WHAT!?!\n") ;
  26.         exit(1) ;
  27.         }
  28.     p = argv[1] ;
  29.     sprintf(buffer, "mince b:%s.c\r", p) ;
  30.     keyset(1, buffer) ;
  31.     sprintf(buffer, "cc b:%s.c\r", p) ;
  32.     keyset(2, buffer) ;
  33.     sprintf(buffer, "clink b:%s\r", p) ;
  34.     keyset(3, buffer) ;
  35.     sprintf(buffer, "b:%s\r", p) ;
  36.     keyset(4, buffer) ;
  37.     }
  38. /*
  39.  * keyset - takes a number and a string, and puts that string in that function
  40.  *    key on a teleray 10.
  41.  */
  42. keyset(key, string) char *string; {
  43.  
  44.     printf("Key F%d is now set to:", key) ;
  45.     printf("\033U%02d%s\033V\n", key, string) ;
  46.     }
  47.